<template>
  <el-dialog
    title="提示"
    :visible.sync="dialogVisible"
    width="80%"
    height="100%"
    :before-close="handleClose"
  >
    <el-table
      :data="tableData"
      style="width: 100%"
      :default-sort="{ prop: 'date', order: 'descending' }"
    >
      <el-table-column prop="date" label="区划" sortable width="180"></el-table-column>
      <el-table-column prop="name" label="单位名称" sortable width="180"></el-table-column>
      <el-table-column prop="address" label="内设机构数" :formatter="formatter"></el-table-column>
      <el-table-column prop="address" label="编制数" :formatter="formatter"></el-table-column>
      <el-table-column prop="address" label="领导职数" :formatter="formatter"></el-table-column>
      <el-table-column prop="address" label="平均年龄" :formatter="formatter"></el-table-column>
    </el-table>
    <span slot="footer" class="dialog-footer">
      <el-button @click="handleClose">取 消</el-button>
      <el-button type="primary" @click="handleClose">确 定</el-button>
    </span>
  </el-dialog>
</template>

<script>
export default {
  props: {
    dialogVisible: {
      default: false,
      type: Boolean
    }
  },
  data() {
    return {
      tableData: [{
        date: '南宁市',
        name: '南宁市第一中学',
        address: '12'
      }, {
        date: '2016-05-04',
        name: '王小虎',
        address: '上海市普陀区金沙江路 1517 弄'
      }, {
        date: '2016-05-01',
        name: '王小虎',
        address: '上海市普陀区金沙江路 1519 弄'
      }, {
        date: '2016-05-03',
        name: '王小虎',
        address: '上海市普陀区金沙江路 1516 弄'
      }]
    }
  },
  methods: {
    formatter(row, column) {
      return row.address;
    },

    handleClose() {
     this.$emit('handleClose')
    }
  }
}
</script>